package com.yj.springbootstudy.config.profile;


import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Service
@Profile("java8")
public class Java7CalculateServiceImpl implements CalculateService {
    @Override
    public Integer sum(Integer... value) {
        System.out.println("Java 7环境下执行");
        int result = 0;
        for (int i = 0; i < value.length; i++) {
            Integer num = value[i];
            result += num;
        }
        return result;
    }
}
